package com.wn.consumer.demo04;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -11-02
 * @desc
 */
@Component
@Slf4j
public class C2Consumer {

    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue("Q2"),
                    exchange = @Exchange(
                            name = "exchange-topic",
                            type = ExchangeTypes.TOPIC
                    ),
                    key = {
                            "*.*.rabbit",
                            "lazy.#"
                    }
            )
    )
    public void handlerMsg(String msg){

        log.info("c2消费者消费:{}",msg);
    }

}
